#include "StdAfx.h"
#include "CdiBody.h"

// Copy Constructor
CdiBody::CdiBody() 
  : m_lookAt( NULL ),
    m_up( NULL )
{

}

CdiBody::CdiBody(CdiLocation& position, CdiLocation& lookAt, CdiLocation& up )
: CdiLocation(position)
{
  m_lookAt = new CdiLocation( lookAt );
  m_up = new CdiLocation( up );
}

CdiBody::~CdiBody(void)
{
  if( m_lookAt )
  {
    delete m_lookAt;
  }
  m_lookAt = NULL;

  if( m_up )
  {
    delete m_up;
  }
  m_up = NULL;
}

CdiBody::CdiBody( CdiBody& Body )
{
  m_lookAt = new CdiLocation( *(Body.m_lookAt) );
  m_up = new CdiLocation( *(Body.m_up) );

  m_x = Body.m_x;
  m_y = Body.m_y;
  m_z = Body.m_z;
  m_incrDelta = Body.m_incrDelta;
}

CdiBody::CdiBody(float x, float y, float z) 
  : m_up( NULL ), m_lookAt( NULL )
{
  m_x = x;
  m_y = y;
  m_z = z;
}
